﻿<UserControl x:Class="Wulong.Phone.Qiushi.Views.PicstoryListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid x:Name="LayoutRoot">
        
        <ScrollViewer VerticalScrollBarVisibility="Auto" Height="400" Grid.Row="0">
        
            <ItemsControl x:Name="PicstoryList">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button Background="Transparent" BorderThickness="0" Padding="0" cal:Message.Attach="[Event Click]=[Action ViewPicture($this)]">                            
                            <Image Source="{Binding ImageUrl}" MaxHeight="160" MaxWidth="160" Margin="8" />
                        </Button>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>

                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</UserControl>
